#!/bin/bash

#
#   create program
#
#   exec on 10.0.0.127(svn server)
#

projectName=$1
projectDevelopers=$2


test -d "/var3/svn/$projectName" && echo "error! $projectName is already exists." && exit -1
svnadmin create /var3/svn/$projectName
rm -f /var3/svn/$projectName/conf/authz
rm -f /var3/svn/$projectName/conf/svnserve.conf
cp /var3/svntemplate/* /var3/svn/$projectName/conf/
sed -i "s/{projectName}/$projectName/g" /var3/svn/$projectName/conf/authz
sed -i "s/{projectDevelopers}/$projectDevelopers/g" /var3/svn/$projectName/conf/authz

svn mkdir -m "mkdir trunk"  svn://127.0.0.1/$projectName/trunk --username tiger --password 'svn555666'
svn mkdir -m "mkdir branches"  svn://127.0.0.1/$projectName/branches --username tiger --password 'svn555666'
svn mkdir -m "mkdir release"  svn://127.0.0.1/$projectName/release --username tiger --password 'svn555666'
svn mkdir -m "mkdir tags"  svn://127.0.0.1/$projectName/tags --username tiger --password 'svn555666'
